//
//  PopoverContentView.swift
//  onemeetingmac
//
//  Created by 张衡 on 2020/6/5.
//  Copyright © 2020 onemeeting. All rights reserved.
//

import Foundation

class PopoverContentView:NSView {
    var backgroundView:PopoverBackgroundView?
    override func viewDidMoveToWindow() {
        super.viewDidMoveToWindow()
        if let frameView = self.window?.contentView?.superview {
            if backgroundView == nil {
                backgroundView = PopoverBackgroundView(frame: frameView.bounds)
                backgroundView!.autoresizingMask = NSView.AutoresizingMask([.width, .height]);
                frameView.addSubview(backgroundView!, positioned: NSWindow.OrderingMode.below, relativeTo: frameView)
            }
        }
    }
}


class PopoverBackgroundView:NSView {
    override func draw(_ dirtyRect: NSRect) {
        color_dark.set()
        self.bounds.fill()
    }
}
